import * as courses from './views'

type name = keyof typeof courses
const refresh = (gl: WebGLRenderingContext, id: string, dom: HTMLCanvasElement) => {
  const name = `createCourse${id}` as name
  const fn: (gl: WebGLRenderingContext, dom: HTMLCanvasElement) => void = courses[name]
  if (!fn) return
  fn(gl, dom)
}

export {
  refresh
}
